from django.db import models

class AIPatient(models.Model):
    """AI模拟病人模型"""
    patient_code = models.CharField(max_length=50, unique=True, verbose_name="病人编号")
    patient_type = models.CharField(max_length=100, verbose_name="病人类型")
    bot_id = models.CharField(max_length=100, unique=True, verbose_name="AI编号", default="default_bot")
    created_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间")
    updated_time = models.DateTimeField(auto_now=True, verbose_name="更新时间")

    class Meta:
        verbose_name = "AI模拟病人"
        verbose_name_plural = "AI模拟病人"
        db_table = "ai_patient"
        ordering = ["-created_time"]

    def __str__(self):
        return f"{self.patient_code} ({self.patient_type})"